﻿module see_tests
open Xunit
open FSharpChess
//simple SEE check
[<Fact>]
let test_seelst() = 
    Psn_tests.setup_pos1() 
    let mv = Funcs.gm.CreateMove(Standard, 0, 4, 36, 28, 0)
    let mf,me = SEE.get_lists mv Funcs.gm
    let cond=mf.Count=0 && me.Count=0
    let mess=mf.Count.ToString() + "-" + me.Count.ToString()
    Assert.True(cond,mess)
[<Fact>]
let test_seeres() = 
    Psn_tests.setup_pos1() 
    let mv = Funcs.gm.CreateMove(Standard, 0, 4, 36, 28, 0)
    let SEEresult = SEE.see_move mv Funcs.gm
    let cond = (SEEresult=100)
    let mess = SEEresult.ToString()
    Assert.True(cond,mess)
//difficult SEE check
[<Fact>]
let test_seelst2() = 
    Psn_tests.setup_pos2() 
    let mv = Funcs.gm.CreateMove(Standard, 1, 19, 36, 28, 0)
    let mf,me = SEE.get_lists mv Funcs.gm
    let cond=mf.Count=2 && me.Count=3
    let mess=mf.Count.ToString() + "-" + me.Count.ToString()
    Assert.True(cond,mess)
[<Fact>]
let test_seeres2() = 
    Psn_tests.setup_pos2() 
    let mv = Funcs.gm.CreateMove(Standard, 1, 19, 36, 28, 0)
    let SEEresult = SEE.see_move mv Funcs.gm
    let cond = (SEEresult= -225)
    let mess = SEEresult.ToString()
    Assert.True(cond,mess)
//promotion SEE check
[<Fact>]
let test_seelst3() = 
    Psn_tests.setup_pos3() 
    let mv = Funcs.gm.CreateMove(Standard, 2, 13, 6, 16, 0)
    let mf,me = SEE.get_lists mv Funcs.gm
    let cond=mf.Count=0 && me.Count=1
    let mess=mf.Count.ToString() + "-" + me.Count.ToString()
    Assert.True(cond,mess)
[<Fact>]
let test_seeres3() = 
    Psn_tests.setup_pos3() 
    let mv = Funcs.gm.CreateMove(Standard, 2, 13, 6, 16, 0)
    let SEEresult = SEE.see_move mv Funcs.gm
    let cond = (SEEresult= -725)
    let mess = SEEresult.ToString()
    Assert.True(cond,mess)
    